/*    */ package com.ui;
/*    */ 
/*    */ import com.engine.ReadConfig;
/*    */ import com.engine.SaveConfig;
/*    */ import java.awt.event.ActionEvent;
/*    */ import java.io.FileNotFoundException;
/*    */ import java.io.IOException;
/*    */ import javax.swing.AbstractAction;
/*    */ import javax.swing.Action;
/*    */ import javax.swing.JDialog;
/*    */ import javax.swing.JTextField;
/*    */ import org.swixml.SwingEngine;
/*    */ 
/*    */ public class LCDConfiguration
/*    */ {
/*    */   JDialog dialog;
/*    */   private JTextField host;
/*    */   private JTextField port;
/* 47 */   public Action doCancel = new AbstractAction()
/*    */   {
/*    */     private static final long serialVersionUID = 1L;
/*    */ 
/*    */     public void actionPerformed(ActionEvent e)
/*    */     {
/*    */       try
/*    */       {
/* 56 */         LCDConfiguration.this.dialog.setVisible(false);
/* 57 */         LCDConfiguration.this.dialog.dispose();
/*    */       }
/*    */       catch (Exception localException)
/*    */       {
/*    */       }
/*    */     }
/* 47 */   };
/*    */ 
/* 65 */   public Action doApply = new AbstractAction()
/*    */   {
/*    */     private static final long serialVersionUID = 1L;
/*    */ 
/*    */     public void actionPerformed(ActionEvent e)
/*    */     {
/*    */       try
/*    */       {
/* 74 */         SaveConfig.getInstance(null);
/* 75 */         SaveConfig.PUT("LCD_IP_CONFIG", LCDConfiguration.this.host.getText());
/* 76 */         SaveConfig.PUT("LCD_PORT", LCDConfiguration.this.port.getText());
/* 77 */         SaveConfig.Close();
/* 78 */         LCDConfiguration.this.dialog.setVisible(false);
/* 79 */         LCDConfiguration.this.dialog.dispose();
/*    */       }
/*    */       catch (Exception localException)
/*    */       {
/*    */       }
/*    */     }
/* 65 */   };
/*    */ 
/*    */   public LCDConfiguration()
/*    */     throws Exception
/*    */   {
/* 24 */     SwingEngine swix = new SwingEngine(this);
/* 25 */     swix.render("xml/lcdconfiguration.xml");
/* 26 */     read();
/* 27 */     this.dialog.setVisible(true);
/* 28 */     this.dialog.setModal(true);
/*    */   }
/*    */ 
/*    */   private void read()
/*    */   {
/*    */     try {
/* 34 */       ReadConfig.removeInstance();
/* 35 */       ReadConfig.getInstance(null);
/*    */     }
/*    */     catch (FileNotFoundException e) {
/* 38 */       e.printStackTrace();
/*    */     }
/*    */     catch (IOException e) {
/* 41 */       e.printStackTrace();
/*    */     }
/* 43 */     this.host.setText(ReadConfig.GET("LCD_IP_CONFIG"));
/* 44 */     this.port.setText(ReadConfig.GET("LCD_PORT"));
/*    */   }
/*    */ }

/* Location:           F:\16 2\SQ.jar
 * Qualified Name:     com.ui.LCDConfiguration
 * JD-Core Version:    0.6.0
 */